<!--<div>-->
<!--  <div class="layui-form-item">-->
<!--    <button class="layui-btn" id="selectAll">确认选择</button>-->
<!--  </div>-->
<!--  <div class="layui-inline">-->
<!--    <label class="layui-form-label w-auto">品种</label>-->
<!--    <div class="layui-input-inline mr0">-->
<!--      <select  id="productVarietyId" name="productVarietyId" lay-filter="productVarietyId"  lay-search required></select>-->
<!--    </div>-->
<!--  </div>-->
<!--  <div class="layui-inline">-->
<!--    <label class="layui-form-label w-auto">牌号</label>-->
<!--    <div class="layui-input-inline mr0">-->
<!--      <select  id="productMarkId" name="productMarkId" lay-filter="productMarkId"  lay-search required></select>-->
<!--    </div>-->
<!--  </div>-->
<!--  <div class="layui-inline">-->
<!--    <label class="layui-form-label w-auto">生产商</label>-->
<!--    <div class="layui-input-inline mr0">-->
<!--      <select  id="productProducerId" name="productProducerId" lay-filter="productProducerId"  lay-search required></select>-->
<!--    </div>-->
<!--  </div>-->

<!--  <div class="layui-inline">-->
<!--    <button class="layui-btn icon-btn color-green" lay-filter="itemSubSearchTwo"-->
<!--            lay-submit layui-form-keyDownSearch="true">查询-->
<!--    </button>-->
<!--    <button class="layui-btn icon-btn color-white" lay-filter="itemResetsTwo"-->
<!--            lay-submit>重置-->
<!--    </button>-->
<!--  </div>-->

<!--  <table class="layui-table" lay-filter="SelectSkuTable" id="SelectSkuTable"></table>-->
<!--</div>-->











<!-- 正文开始 -->
<div class=" layui-form open-form">
  <div class="open-model">
    <div class="open-auto">

      <div class="layui-form lay-header" style="margin-top: 20px;height: 60px">
        <div class="toolbar">
          <div class="layui-form-item lay-query-content">
            <div class="lay-query-box">
              <div class="query-lt">
                <div class="layui-inline">
                  <label class="layui-form-label w-auto">品种</label>
                  <div class="layui-input-inline mr0">
                    <select  id="productVarietyId" name="productVarietyId" lay-filter="productVarietyId"  lay-search required></select>
                  </div>
                </div>
                <div class="layui-inline">
                  <label class="layui-form-label w-auto">牌号</label>
                  <div class="layui-input-inline mr0">
                    <select  id="productMarkId" name="productMarkId" lay-filter="productMarkId"  lay-search required></select>
                  </div>
                </div>
                <div class="layui-inline">
                  <label class="layui-form-label w-auto">生产商</label>
                  <div class="layui-input-inline mr0">
                    <select  id="productProducerId" name="productProducerId" lay-filter="productProducerId"  lay-search required></select>
                  </div>
                </div>
                <div class="layui-inline">
                  <button class="layui-btn icon-btn color-green" lay-filter="itemSubSearchTwo"
                          lay-submit layui-form-keyDownSearch="true">查询
                  </button>
                  <button class="layui-btn icon-btn color-white" lay-filter="itemResetsTwo"
                          lay-submit>重置
                  </button>
                </div>
              </div>
              <div class="query-rt"></div>
            </div>
          </div>
        </div>
      </div>
      <div class="layui-form-item ">
        <button class="layui-btn" id="selectAll">确认选择</button>
      </div>

      <!-- 表格 -->
      <table class="layui-table" lay-filter="SelectSkuTable" id="SelectSkuTable"></table>

<!--      <table class="layui-table" id="warehouseMaterialRequisitionRecordTable"-->
<!--             lay-filter="warehouseMaterialRequisitionRecordTable"></table>-->
    </div>

  </div>
</div>

<script>
  layui.use(["layer", "form", "table", "admin", "laydate", "upload", "laytpl"], async function () {
    const table = layui.table;
    const config = layui.config;
    const laytpl = layui.laytpl;
    const form = layui.form;
    const admin = layui.admin;
    const layer = layui.layer;
    const upload = layui.upload;
    const laydate = layui.laydate;
    const $ = layui.jquery;
    const nowData = { ...parentData };
    console.log("nowData", nowData);
    let url = 'warehouse/warehouse/productInventory/list'
    if (nowData.productStatus){
      url = 'warehouse/warehouse/productInventory/list?productStatus=' + nowData.productStatus
    }

    await admin.initDataSelectPro(
            "warehouse/warehouse/admin/productVariety/list",
            {
              limit: 99999,

            },
            "productVarietyId",
            "品种",
            (d) => {
              if (d.value) {
                productVarietyId = d.value;
              }
            },
            "varietyName"
    );

    await admin.initDataSelectPro(
            "warehouse/warehouse/admin/productMark/list",
            {
              limit: 99999,

            },
            "productMarkId",
            "牌号",
            (d) => {
              if (d.value) {
                productMarkId = d.value;
              }
            },
            "markName"
    );

    await admin.initDataSelectPro(
            "warehouse/warehouse/admin/productProducer/list",
            {
              limit: 99999,

            },
            "productProducerId",
            "生产商",
            (d) => {
              if (d.value) {
                processingType = d.value;
              }
            },
            "producerName"
    );


   var tableTwo = table.render({
      elem: "#SelectSkuTable",
      url: config.base + url,
      where: {
        customerId: nowData.customerId,
        notIds: nowData.notIds
      },
      page: true,
      cols: [
        [
          { type: "checkbox" },
          { type: "numbers", title: "序号" },
          // { field: "productCode", align: "center", title: "物料编号" },
          { field: "userBundleCode", align: "center", title: "捆包号" },
          { field: "productProducer", align: "center", title: "厂家" },
          { field: "productVariety", align: "center", title: "品种" },
          { field: "productMark", align: "center", title: "牌号" },
          // { field: "productBrand", align: "center", title: "品牌" },
          { field: "productMainUnit", align: "center", title: "计量单位" },
          { field: "grossWeight", align: "center", title: "标准毛重" },
          {
            field: "netWeight",
            align: "center",
            title: "标准净重"
          },
          {
            field: "quantity",
            align: "center",
            title: "库存数量"
          }
        ]
      ]
    });

    // 搜索
    form.on("submit(itemSubSearchTwo)", function (data) {
      tableTwo.reload({
        where: {
          ...data.field,
        },
        page: { curr: 1 }
      });
    });

    // 重置搜索
    form.on("submit(itemResetsTwo)", function (data) {
      tableTwo.reload({
        where: {
          ...admin.resetSearch(data.field),
        },
        page: { curr: 1 }
      });
    });

    form.render("select");


    $("#selectAll").click(function () {
      const checkStatus = table.checkStatus("SelectSkuTable").data;
      childData.skuList = checkStatus;
      layer.close(nowData.zindex);
    });
  });
</script>

<style>
  .open-auto{
    position: relative;
    z-index: 10000;
    overflow: visible !important;
  }
  .layui-form-select dl{
    max-height:116.1px !important;
  }
  </style>